home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5892 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  79 lines

  1. Path: news.kreonet.re.kr!usenet
  2. From: jwhahn@cair.kaist.ac.kr (Jung Hahn)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: LPCREATESTRUCT
  5. Date: Wed, 07 Feb 1996 11:46:18 GMT
  6. Organization: Applied Database Labs, K.A.I.S.T
  7. Message-ID: <311890b8.13412781@news.kreonet.re.kr>
  8. References: <4f8qum$cck@guitar.sound.net>
  9. NNTP-Posting-Host: swine.kaist.ac.kr
  10. X-Newsreader: Forte Agent .99d/32.168
  11.  
  12. On Wed, 07 Feb 1996 14:13:43 GMT, chris@sound.net (chris) wrote:
  13.  
  14. >I am unable to determine what lpcreatestruct in doing in the following
  15. >line of code.  It is in a windows procedure, within the code that is
  16. >executed during the processing of the wm_create message.
  17. >
  18. >hInstance = ((LPCRETESTRUCT) lParam) -> hInstance;
  19. >
  20. >If you can point me in the right direction, I would appreciate it.
  21. >Also, do you know where I might find this in the online documentation
  22. >for the Borland Compiler (version 4.2).
  23. >
  24. >Thank You,
  25. >
  26. >chris@sound.net
  27. >
  28.  
  29. Yeah ... You see lParam Has no definite type .... 
  30.  
  31. get what I mean ?
  32. hmm ... put it in another way .... You wanna use the lParam as a
  33. LPCRETE  ETC structure so you type cast it to LPCRETESTRUCT...
  34. and use the hInstance member of that structure....
  35.  
  36. here is an example.
  37.  
  38. struct lalala {
  39.     int i,j,k;
  40.     char *lala;
  41.     float flala;
  42.     };
  43.  
  44. #define    LALALASIZE    sizeof( struct lalala)
  45.  
  46. char *Buffer;
  47.  
  48. main()
  49. {
  50. int     i, j, k;
  51. float    f;
  52.     Buffer = ( char *) malloc( LALALASIZE);
  53.  
  54. /* Now you wanna use Buffer as a buffer to a lalala structure... ok? 
  55.     so you go like this */
  56.  
  57. f = ((struct lalala)Buffer)->flala;
  58. i = ((struct lalala)Buffer)->i;
  59.  
  60. /* ok ??? 
  61. It's better than doing something like this ....
  62. */
  63.  
  64. i = Buffer[3]<<8+Buffer[2]<<16+Buffer[1]<<24+Buffer[0]<<32; ...
  65. .
  66. .
  67. .
  68. I cannot even guess for flala .. :) 
  69. }
  70.  
  71. good luck ...
  72.  
  73. sorry I know nothing about windows programming ..:) 
  74. ___________
  75.  
  76.     Name:  Jung w. Hahn
  77.     Elm:   jwhahn@cair.kaist.ac.kr
  78.     Phone: 042-869-2959
  79.